package cn.iocoder.yudao.module.indicator.controller.admin;

import cn.iocoder.yudao.module.indicator.domain.dto.IndexCalculationDto;
import cn.iocoder.yudao.module.indicator.domain.vo.IndexCalculationVo;
import cn.iocoder.yudao.module.indicator.service.index.IndexCalculationService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/indexCalculate")
@Tag(name = "指标 - 指标计算")
public class IndexCalculationController {

    @Resource
    IndexCalculationService indexCalculationService;
    /**
     * 功能描述: 查询单指标的值
     * @param indexCalculationDto
     * @return
     */
    @GetMapping("getIndex")
    public IndexCalculationVo getIndex(IndexCalculationDto indexCalculationDto) {
        return indexCalculationService.getIndex(indexCalculationDto);
    }

    /**
     * 功能描述: 指标往期数据对比
     * @param:
     * @return:
     * @author: ZWC
     * @date: 2024/10/22
     */
    @GetMapping("getIndexPreviousData")
    IndexCalculationVo getIndexPreviousData(IndexCalculationDto indexCalculationDto) {
        return indexCalculationService.getIndexPreviousData(indexCalculationDto);
    }

    /**
     * 功能描述:列出每个机构的指标值
     * @param indexCalculationDto
     * @return
     */
    @GetMapping("getDeptIndex")
    public IndexCalculationVo getDeptIndex(IndexCalculationDto indexCalculationDto){
        return indexCalculationService.getDeptIndex(indexCalculationDto);
    }

    /**
     * 查询医生指标明细数据
     * @param indexCalculationDto
     * @return
     */
    @GetMapping("getDoctorIndex")
    public IndexCalculationVo getDoctorIndex(IndexCalculationDto indexCalculationDto){
        return indexCalculationService.getDoctorIndex(indexCalculationDto);
    }

    /**
     * 查询诊室数据
     * @param indexCalculationDto
     * @return
     */
    @GetMapping("getRoomIndex")
    public IndexCalculationVo getRoomIndex(IndexCalculationDto indexCalculationDto){
        return indexCalculationService.getRoomIndex(indexCalculationDto);
    }
    /**
     * 查询指标历史趋势
     * @param indexCalculationDto
     * @return
     */
    @GetMapping("getIndexTrend")
    public IndexCalculationVo getIndexTrend(IndexCalculationDto indexCalculationDto){
        return indexCalculationService.getIndexTrend(indexCalculationDto);
    }

    /**
     * 查询元素指标趋势
     * @param indexCalculationDto
     * @return
     */
    @GetMapping("getElementTrend")
    public IndexCalculationVo getElementTrend(IndexCalculationDto indexCalculationDto){
        return indexCalculationService.getElementTrend(indexCalculationDto);
    }
}
